<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8">
 	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="x-ua-compatible" content="ie=edge">
	<link rel="icon" href="https://jscdn.com.cn/highcharts/images/favicon.ico">
	<meta name="description" content="">
	<title>数据功能模块加载 CSV 数据</title>
	<style>
	#csv {
	display: none;
}
	</style>
	<script src="https://code.highcharts.com.cn/jquery/jquery-1.8.3.min.js"></script>
	<script src="https://code.highcharts.com.cn/highcharts/highcharts.js"></script>
	<script src="https://code.highcharts.com.cn/highcharts/modules/data.js"></script>
</head>
<body>
<!--
*************************************************************************
    Generated by JShare at 2020-08-04 14:44:53
    From: https://code.hcharts.cn/hcharts.cn/Y4M8Dg/3
*************************************************************************
-->
<div id="container" style="height: 400px; min-width: 310px"></div>

	<script>
        var options = {
            chart: {
                type: 'column'
            },
            title: {
                text: '水果消费情况'
            },
            xAxis: {
                categories: []
            },
            yAxis: {
                title: {
                    text: '单位'
                }
            },
            series: []
        };
        	//var csv = document.getElementById('csv').innerHTML;
$.get('fruit.csv', function(data) {
    // 分隔每一行
    var lines = data.split('\n');

    // 遍历每一行
    $.each(lines, function(lineNo, line) {
        var items = line.split(',');

        // 处理第一行，即分类
        if (lineNo == 0) {
            $.each(items, function(itemNo, item) {
                if (itemNo > 0) {
                    options.xAxis.categories.push(item);
                }
            });
        }

        // 处理其他的每一行
        else {
            var series = {
                data: []
            };
            $.each(items, function(itemNo, item) {
                if (itemNo == 0) {
                    series.name = item;   // 数据列的名字
                } else {
                    series.data.push(parseFloat(item)); // 数据，记得转换成数值类型
                }
            });
            // 最后将数据 push 到数据列配置里
            options.series.push(series);
        }
    });
    var chart = Highcharts.chart('container', options)
});

</script>
</body>
</html>
<!--{% if platforms %}-->
        <!--/home/admin/fmz-btc-strategy/cum_returns_202803.csv
        <script src="http://code.highcharts.com.cn/highstock/8.1.2/highcharts-more.js"></script>
        <script src="http://code.highcharts.com.cn/highstock/8.1.2/modules/export-data.js"></script>
        <script src="http://code.highcharts.com.cn/highstock/8.1.2/modules/full-screen.js"></script>
        <script src="http://code.highcharts.com.cn/highstock/8.1.2/modules/heatmap.js"></script>
        <script src="http://code.highcharts.com.cn/highstock/8.1.2/modules/histogram-bellcurve.js"></script>
        <script src="http://code.highcharts.com.cn/highstock/8.1.2/themes/dark-unica.js"></script>
        <script src="http://code.highcharts.com.cn/highstock/8.1.2/css/themes/dark-unica.css"></script>
        $.get('G:\\zwrk\\cum_returns_202803.csv',function(csv) {
            });
                    xAxis : {
                        type : 'datetime'
                    },
                        max: 15000
        -->
<!-- 图表容器 DOM --><!--
{% else %}
<div class="alert alert-danger" role="alert" style="margin-top:20px">
    <a href="/exchanges">你好, 还没有绑定任何资产, 点击进行资产绑定 !</a>
</div>
{% endif %}-->